import {removeToken} from "@/utils/auth";
const user={
  state:{
    userInfo: {},
    permissions:[]
  },
  mutations:{
    // 获取用户信息
    GET_USERINFO: (state, userInfo) => {
      state.userInfo = userInfo
    },
  },
  actions: {
    // 退出登录
    FedLogOut({ commit }) {
      // 去掉登录的用户信息
      return new Promise(resolve => {
        localStorage.clear()
        removeToken()
        resolve()
      })
    }
  }
}
export default user